<?php

/**
* This is the model class for table "TB_QTC_FILE_ATTC".
*
* The followings are the available columns in table 'TB_QTC_FILE_ATTC':
    * @property integer $ATTC_GRP_CODE
    * @property integer $SEQ_NO
    * @property string $ORG_FILE_NAME
    * @property string $SERVER_FILE_NAME
    * @property string $SERVER_PATH
    * @property string $FILE_COMT
    * @property string $MAIN_YN
    * @property double $FILE_SIZE
    * @property string $FIRST_REG_USER
    * @property string $LAST_UPD_USER
    * @property string $FIRST_REG_DT
    * @property string $LAST_REG_DT
*/
class FileAttach extends CActiveRecord
{
/**
* @return string the associated database table name
*/
public function tableName()
{
    return 'TB_QTC_FILE_ATTC';
}

/**
* @return array validation rules for model attributes.
*/
public function rules()
{
// NOTE: you should only define rules for those attributes that
// will receive user inputs.
return array(
    array('ATTC_GRP_CODE, SEQ_NO, ORG_FILE_NAME, SERVER_FILE_NAME, SERVER_PATH, FILE_COMT, MAIN_YN, FILE_SIZE, FIRST_REG_USER, LAST_UPD_USER, FIRST_REG_DT, LAST_REG_DT', 'required'),
    array('ATTC_GRP_CODE, SEQ_NO', 'numerical', 'integerOnly'=>true),
    array('FILE_SIZE', 'numerical'),
    array('ORG_FILE_NAME, SERVER_FILE_NAME, SERVER_PATH, FILE_COMT, FIRST_REG_USER, LAST_UPD_USER', 'length', 'max'=>100),
    array('MAIN_YN', 'length', 'max'=>1),
// The following rule is used by search().
// @todo Please remove those attributes that should not be searched.
array('ATTC_GRP_CODE, SEQ_NO, ORG_FILE_NAME, SERVER_FILE_NAME, SERVER_PATH, FILE_COMT, MAIN_YN, FILE_SIZE, FIRST_REG_USER, LAST_UPD_USER, FIRST_REG_DT, LAST_REG_DT', 'safe', 'on'=>'search'),
);
}

/**
* @return array relational rules.
*/
public function relations()
{
// NOTE: you may need to adjust the relation name and the related
// class name for the relations automatically generated below.
    return array(
        'groupFile' => array(self::HAS_MANY, 'GroupFile', 'ATTC_GRP_CODE', 'joinType'=>'INNER JOIN'),
    );
}

/**
* @return array customized attribute labels (name=>label)
*/
public function attributeLabels()
{
return array(
    'ATTC_GRP_CODE' => 'Attc Grp Code',
    'SEQ_NO' => 'Seq No',
    'ORG_FILE_NAME' => 'Org File Name',
    'SERVER_FILE_NAME' => 'Server File Name',
    'SERVER_PATH' => 'Server Path',
    'FILE_COMT' => 'File Comt',
    'MAIN_YN' => 'Main Yn',
    'FILE_SIZE' => 'File Size',
    'FIRST_REG_USER' => 'First Reg User',
    'LAST_UPD_USER' => 'Last Upd User',
    'FIRST_REG_DT' => 'First Reg Dt',
    'LAST_REG_DT' => 'Last Reg Dt',
);
}

/**
* Retrieves a list of models based on the current search/filter conditions.
*
* Typical usecase:
* - Initialize the model fields with values from filter form.
* - Execute this method to get CActiveDataProvider instance which will filter
* models according to data in model fields.
* - Pass data provider to CGridView, CListView or any similar widget.
*
* @return CActiveDataProvider the data provider that can return the models
* based on the search/filter conditions.
*/
public function search()
{
// @todo Please modify the following code to remove attributes that should not be searched.

$criteria=new CDbCriteria;

		$criteria->compare('ATTC_GRP_CODE',$this->ATTC_GRP_CODE);
		$criteria->compare('SEQ_NO',$this->SEQ_NO);
		$criteria->compare('ORG_FILE_NAME',$this->ORG_FILE_NAME,true);
		$criteria->compare('SERVER_FILE_NAME',$this->SERVER_FILE_NAME,true);
		$criteria->compare('SERVER_PATH',$this->SERVER_PATH,true);
		$criteria->compare('FILE_COMT',$this->FILE_COMT,true);
		$criteria->compare('MAIN_YN',$this->MAIN_YN,true);
		$criteria->compare('FILE_SIZE',$this->FILE_SIZE);
		$criteria->compare('FIRST_REG_USER',$this->FIRST_REG_USER,true);
		$criteria->compare('LAST_UPD_USER',$this->LAST_UPD_USER,true);
		$criteria->compare('FIRST_REG_DT',$this->FIRST_REG_DT,true);
		$criteria->compare('LAST_REG_DT',$this->LAST_REG_DT,true);

return new CActiveDataProvider($this, array(
'criteria'=>$criteria,
));
}

/**
* Returns the static model of the specified AR class.
* Please note that you should have this exact method in all your CActiveRecord descendants!
* @param string $className active record class name.
* @return FileAttach the static model class
*/
public static function model($className=__CLASS__)
{
return parent::model($className);
}
}
